package _06_For;
/**
 * 求 1-100的累加加和
 * 
 * 求 1-100 的 偶数和
 * @author lenovo
 *
 */
public class For_03 {
	
	public static void main(String[] args) {
		int sum = 0,even=0;
		//sum是累加加和,even是偶数和
		for (int i = 1; i <= 100; i++) {
			sum += i;
			//sum记录1-100
			if(i%2 == 0) {
				even += i;
				//even记录偶数
			}
		}
		System.out.println("1-100的累加加和 = " + sum);
		System.out.println("1-100的偶数和 = " + even);
	}
}
